--
-- Author: shunguo.chen
-- Date: 2018-01-11 18:33:37
--
-- CosplayChoice 选人信息

local UserBaseInfo = require("app.public.dao.UserBaseInfo")

local fileName = string.getModeName(...)
local ClassRef = class(fileName)

function ClassRef:ctor(data)
	if data then
		self:init(data)
	end
end

-- message RollChoice {
--    int32 uid = 1;
--    base.UserBaseInfo userInfo = 2;
--    int32 rollID = 3; //初始值为 -1
-- }
function ClassRef:init(data)
	self.uid = data.uid
	self.rollID = data.rollID
	self.userInfo = UserBaseInfo.new(data.userInfo)

	self._role = nil
end

function ClassRef:getUserName()
	return self.userInfo.name
end

function ClassRef:isMe()
	return self.uid == UD:getUid()
end

function ClassRef:isChoose()
	return self.rollID > 0
end

function ClassRef:setRole(role)
	self._role = role
end

function ClassRef:getRole()
	return self._role
end

function ClassRef:getRoleAvatarParams()
	return self._role:getAvatarParams()
end

return ClassRef